<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>注册</title>
		<script type="text/javascript" src="js/vue.min.js" charset="utf-8"></script>
		<script type="text/javascript" src="js/vue-resource.min.js" charset="utf-8"></script>
</head>
<body>
		<div id="box">
			<form>
				用户名:<input type="text" v-model="name" /><br />
				密码:<input type="password" v-model="pass" /><br />
				<input type="submit" value="注册" @click="ZhuCe" />
			</form>
		</div>
	</body>
	<script>
		var vm = new Vue({
			el:"#box",
			data:{
				name:"",
				pass:""
			},
			/*  */
			methods:{
				ZhuCe(){
					this.$http.get('RegisterServlet',{
						params:{
							username:this.name,
							userpass:this.pass
						}
					}).then(function(obj){
					/* data 代表数据转换,和vue中的 data 不是一回事情 */
						alert("****成功*****:"+obj.data.msg);
					},function(){
						alert("***失败*****")
					});
				}
			}
		});
	</script>
</html>